#include "RedBlackTree.h"

int main(int argc, char *argv[])
{
    RedBlackTree<int> A;  //insert 7,2,1,9 into A
    A.rbinsert(7);
    A.rbinsert(2);
    A.rbinsert(9);
    A.rbinsert(1);
    
    //check insert and inorderwalk
    A.inorder_walk();  
    std::cout << "After RBT:" << std::endl;    //check color
    std::cout << "7    " << A.tree_search(7)->color << std::endl;
    std::cout << "1    " << A.tree_search(1)->color << std::endl;
    std::cout << "2    " << A.tree_search(2)->color << std::endl;
    std::cout << "9    " << A.tree_search(9)->color << std::endl;
    
	//check delete
    A.rbdel(2);    
    A.inorder_walk();
    std::cout << "After delete 2:" << std::endl;
    std::cout << "1    " << A.tree_search(1)->color << std::endl;
    std::cout << "9    " << A.tree_search(1)->color << std::endl;
    std::cout << "7    " << A.tree_search(1)->color << std::endl;
    
    return 0;
}
